﻿
<CnGalWebSite.Shared.MasaComponent.Shared.MaterialDesigns.MDMainInfoCard Name="@(string.IsNullOrWhiteSpace(Model.ObjectName) ? ("Id：" + Model.ObjectId) : Model.ObjectName)" Image="@Model.Image" Thumbnail="Model.IsThumbnail"
                                                                         BriefIntroduction="@Model.ObjectBriefIntroduction" Href="@url" Class="@($"edit-record-overview-main-card {Class}")"/>

@code {
    [Parameter]
    public ExamineViewModel Model { get; set; }
    [Parameter]
    public string Class { get; set; }

    string url;

    protected override void OnParametersSet()
    {
        url = Model.Type switch
        {
            ExaminedNormalListModelType.Entry => "/entries/index/" + Model.ObjectId,
            ExaminedNormalListModelType.Article => "/articles/index/" + Model.ObjectId,
            ExaminedNormalListModelType.Periphery => "/peripheries/index/" + Model.ObjectId,
            ExaminedNormalListModelType.Tag => "/tags/index/" + Model.ObjectId,
            ExaminedNormalListModelType.Video => "/videos/index/" + Model.ObjectId,
            _ => null
        };
    }
}
